<template>
  <div class="form-container" >
    <el-tabs type="border-card">
      <div>
        <p class="content-tit">预印刷申请</p>
        <el-form :label-position="labelPosition" label-width="100px" :model="formData">
          <el-row type="flex" class="row-bg">
            <el-col :span="8">
              <el-form-item label="征订审批规则" size="mini">
                <el-select v-model="formData.checkedType2" filterable placeholder="请选择">
                  <el-option
                    v-for="item in checkedTypeList2"
                    :key="item.code"
                    :label="item.codeName"
                    :value="item.code">
                    <span>{{ item.code }}</span> - <span>{{ item.codeName }}</span>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="征订开始日期" size="mini">
                <el-date-picker type="date" v-model="formData.startDate" placeholder="选择时间" :value-format="'yyyy-MM-dd'"
                                :format="'yyyy-MM-dd'"></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="征订结束日期" size="mini">
                <el-date-picker type="date" v-model="formData.endDate" placeholder="选择时间" :value-format="'yyyy-MM-dd'"
                                :format="'yyyy-MM-dd'"></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div align="right">
          <el-button type="primary" @click="query" icon="el-icon-search">查询</el-button>
          <el-button @click="" type="primary">清空</el-button>
        </div>
      </div>
      <div>
        <p class="content-tit">
          <span @click="isShow('isShowSingle')" v-if='isShowSingle'>-</span>
          <span @click="isShow('isShowSingle')" v-else>+</span>征订申请信息
        </p>
        <el-table :data="usersList" ref="userTable" @selection-change="handleSelectionChange" style="width: 100%"
                  class='table-common' :highlight-current-row="true" border
                  v-show="isShowSingle">
          <el-table-column label="#" checked="selectionData"
                           type="selection"
                           min-width="6%">
          </el-table-column>
          <el-table-column label="序号" type='index' min-width="8%" align="center"></el-table-column>
          <el-table-column label="征订批次号" min-width="10%" align="center"></el-table-column>
          <el-table-column label="征订机构" min-width="10%" align="center"></el-table-column>
          <el-table-column label="征订时间" min-width="10%" align="center"></el-table-column>
          <el-table-column label="审批规则" min-width="20%" align="center"></el-table-column>
          <el-table-column label="操作" min-width="14%" align="center">
          </el-table-column>
        </el-table>
        <div class="mar15 " align="right" v-show="isShowSingle">
          <el-pagination
            @current-change="handleCurrentChange"
            :current-page="publicPage.currentPage"
            :page-size="publicPage.perPage"
            layout="total, prev, pager, next, jumper"
            :total="publicPage.totalSize">
          </el-pagination>
        </div>
      </div>
      <div align="right">
        <el-button type="primary" @click="">预印刷申请</el-button>
      </div>
    </el-tabs>
  </div>

</template>

<script>
  export default {
    name: "print-apply",
    data() {
      return {
        isShowSingle: true,
        dialogTableVisible: false,
        labelPosition: 'right',
        formData: {
          checkedType2: '',
          startDate: '',
          endDate: ''
        },
        selfPage: {
          currentPage: 1,
          hasMore: true,
          perPage: 10,
          totalPage: 0,
          totalSize: 0
        },
        publicPage: {
          currentPage: 1,
          hasMore: true,
          perPage: 10,
          totalPage: 0,
          totalSize: 0
        },
        checkedTypeList2: [{code: '1', codeName: '支公司 -> 分公司 -> 总公司'}, {code: '2', codeName: '分公司 -> 总公司'}],
        planTotalList: [],
        planList: []
      }
    },
    methods: {
      isShow(val) {
        this[val] = !this[val]
      },
      handleSelectionChange(val) {
        this.selectionData = val
      },
      handleCurrentChange(num) {
        this.selfFormData.pageNum = num
      },
      handleCurrentChangeSingle(num) {
        this.selfFormData.pageNum = num
      },
    }
  }
</script>

<style scoped>

</style>
